import request from '../utils/request';

// 获取商品列表的接口调用方法
export const getCommodityListService = (CommodityPageQueryReqDTO) => {
    return request.get('/Treasure-Pavilion-admin/commodity/page', {
        params: CommodityPageQueryReqDTO
    });
};

// 增加商品接口
export const saveCommodityService = (CommoditySaveReqDTO) => {
    return request.post('/Treasure-Pavilion-admin/commodity/save', CommoditySaveReqDTO
    );
};

// 修改商品接口
export const updateCommodityService = (CommodityUpdateReqDTO) => {
    return request.put('/Treasure-Pavilion-admin/commodity/update', CommodityUpdateReqDTO
    );
};

// 删除商品接口
export const deleteCommodityService = (id) => {
    return request.delete(`/Treasure-Pavilion-admin/commodity/delete/${id}`);
};
